import 'package:flutter/material.dart';
import 'package:flutter_queen_demo/widget/sticky/sticky_header.dart';

class CalendarPage extends StatefulWidget {
  const CalendarPage({Key? key}) : super(key: key);

  @override
  State<CalendarPage> createState() => _CalendarPageState();
}

class _CalendarPageState extends State<CalendarPage> {
  final String url = "https://lmg.jj20.com/up/allimg/tp06/20111116343444U-0-lp.jpg";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("日历"),
        centerTitle: true,
      ),
      body: ListView.builder(
        itemCount: 50,
        itemBuilder: (context, index) {
          return StickyHeader(
            header: Container(
              height: 50.0,
              color: Colors.blueGrey[700],
              padding: const EdgeInsets.symmetric(
                horizontal: 16.0,
              ),
              alignment: Alignment.centerLeft,
              child: Text(
                'Header #$index',
                style: const TextStyle(
                  color: Colors.white,
                ),
              ),
            ),
            content: Image.network(
              url,
              fit: BoxFit.cover,
              width: double.infinity,
              height: 200.0,
            ),
          );
        },
      ),
    );
  }
}
